package com.biz.hunter.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.biz.hunter.dao.CompanyDAO;
import com.biz.hunter.db.entity.Company;
import com.biz.hunter.service.ICompanyService;
@Service
public class CompanyService implements ICompanyService
{

	@Autowired
	private CompanyDAO compDAO;

	@Override
	public List<Company> getAllCompanys() {
		return compDAO.getALL();
	}

	@Override
	public void createCompany(Company company) {
		compDAO.save(company);
	}



	@Override
	public void updateCompany(Company company) {
		compDAO.update(company);		
	}

	@Override
	public Company searchCompanyByID(Integer Id) {
		return compDAO.getById(Id.intValue());
	}

	@Override
	public Company getCompanyByName(String name) {
		return compDAO.getByName(name);
	}

	@Override
	public void deleteCompany(Company company) {
		compDAO.deleteById(company.getId());
		
	}

	@Override
	public void createTempCompany(Company company) {
	      //TODO tempCompDAO.save(company);
	}

	@Override
	public Object getTemCompany() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void deleteTempCompany() {
		// TODO Auto-generated method stub
		
	}

	

}
